/**
 * author: XGP
 * date: 2018/07/25
 * des: 人员招聘-招聘规划
 */
import request from '@/utils/request'

/**
 * 查询招聘信息状态统计
 */
export function getPlanaudit() {
  return request({
    url: '/interviewers/findStatusCount',
    method: 'get'
  })
}


/**
 * 候选，初选通过，面试
 */
export function getRequireList(params) {
  // console.log(params)
  return request({
    url: '/interviewers/findAll',
    method: 'get',
    params: params
  })
}

/**
 * 详情页面
 */
export function findDetail(intvId) {
  return request({
    url: '/interviewers/findDetail/' + intvId,
    method: 'get'

  })
}
/**
 * 新增候选人
 * // url: '/hr/recruit/interviewmanage/addInterview/mock',
 */
export function addInterview(data) {
  return request({
    url: '/interviewers/insertInterviewer',
    method: 'post',
    data
  })
}
/**
 * 编辑候选人
 *
 * @param {*} data
 */
export function updateInterviewer(data) {
  return request({
    url: '/interviewers/updateInterviewer',
    method: 'put',
    data
  })
}


/**
 * 安排面试
 */
export function arrangeInterview(data) {
  return request({
    url: '/interviewers/planInterviewer?status='+data.status,
    method: 'put',
    data
  })
}

/**
 * 删除候选人
 */
export function deleteInterview(intvId) {
  const data = {
    intvId: intvId
  }
  return request({
    url: '/interviewers/deleteInterviewer',
    method: 'delete',
    params: data
  })
}

/**
 * 状态更新
 * @param {*} params
 */
export function updateStatus(params) {
  return request({
    url: '/interviewers/updateStatus',
    method: 'put',
    params: params
  })
}
/**
 * 淘汰流失
 * @param {*} params
 */
export function eliminate(data) {
  return request({
    url: '/interviewers/eliminate?paramsName='+data.paramsName,
    method: 'put',
    data
  })
}

/**
 * offer发出申请，offer审批
 * @param {*} params
 */
export function offerSendApply(data) {
  return request({
    url: '/interviewers/sendOffer',
    method: 'put',
    params: data
  })
}
/**
 * 查询面试信息
 * @param {*} data
 */
export function findProcessDetail(id) {
  return request({
    url: '/interviewers/InterviewerProcessBean/' + id,
    method: 'get'
  })
}


/**
 * 面试通过
 * @param {*} params
 */
export function passInterviewer(data) {
  return request({
    url: '/interviewers/passInterviewer',
    method: 'put',
    data
  })
}
/**
 * 马上复试
 * @param {*} params
 */
export function immediateInterviewer(data) {
  return request({
    url: '/interviewers/immediateInterviewer',
    method: 'put',
    data
  })
}

/**
 * 等待复试
 * @param {*} params
 */
export function waitInterviewer(data) {
  return request({
    url: '/interviewers/waitInterviewer',
    method: 'put',
    data
  })
}



/**
 * 反馈通过不通过
 * @param {*} params
 */
export function feedBackOffer(data) {
  return request({
    url: '/interviewers/feedBackOffer',
    method: 'put',
    data: data
  })
}

export function getPositionApi(params) {
  return request({
    url: '/hr/recruitment/recruitplan/findPositionByOrg',
    method: 'get',
    params: params
  })
}

/**
 * 60 根据员工部门，岗位查询职级
 */
export function getRankApi(params) {
  return request({
    url: '/hr/salary/salaryfixs/findLevel',
    method: 'get',
    params: params
  })
}
